'use strict';

const { Controller } = require('egg');

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }
  async getShopTotalData() {
    try {
      let data = await this.ctx.service.home.getShopTotal();
      this.ctx.body = {
        code: 20000,
        message: '获取商城统计信息成功',
        data
      };
    } catch (err) {
      this.ctx.body = {
        code: 50000,
        message: '服务器错误',
      };
    }
  }
}

module.exports = HomeController;
